<template>
    <div class="diy-title-step">
        <div :class="['step',`step-${stepNum}`]">
            <div class="step-item">
                <i class="step-icon"></i>
                生成审查清单
            </div>
            <div class="step-item">
                <i class="step-icon"></i>
                AI智能审查
            </div>
            <div class="step-item">
                <i class="step-icon"></i>
                查看审查结果
            </div>
        </div>
    </div>
</template>

<script lang="ts" setup>
import { withDefaults, defineProps } from 'vue'

const props = withDefaults(
    defineProps<{
        stepNum?: number;
    }>(),
    {
        stepNum: 1
    }
)

console.log(props.stepNum); // 调试输出 stepNum 的值
</script>

<style scoped lang="scss">
.diy-title-step{
    background-color: #fff;
    position: relative;
    .step{
        display: flex;
        width: 508px;
        height: 112px;
        margin: 0 auto;
        justify-content: space-between;
        .step-item{
            position: relative;
            font-family: PingFang SC, PingFang SC;
            font-weight: 400;
            font-size: 14px;
            color: #999;
            margin-top: 64px;
            .step-icon{
                position: absolute;
                top: -34px;
                left: 50%;
                margin-left: -12px;
                width: 24px;
                height: 24px;
                z-index: 1;
                background-image: url(@/assets/diy/title-step-1.svg);
            }
        }
        .step-item::after{
            position: absolute;
            height: 8px;
            width: 218px;
            top: -25px;
            left: 33px;
            content: '';
            background-color: #eee;
        }
        .step-item:last-child::after{
            display: none;
        }
    }
    .step-1{
        .step-item:first-child{
            color: #333;
            .step-icon{
                background-image: url(@/assets/diy/title-step-2.svg);
            }
        }
    }
    .step-2{
        .step-item:first-child{
            color: #3067EF;
            .step-icon{
                background-image: url(@/assets/diy/title-step-3.svg);
            } 
        }
        .step-item:nth-child(2){
            color: #333;
            .step-icon{
                background-image: url(@/assets/diy/title-step-2.svg);
            }
        }
        .step-item:first-child::after{
            background-color: #3067EF;
        }
    }
    .step-3{
        .step-item:first-child,
        .step-item:nth-child(2){
            color: #3067EF;
            .step-icon{
                background-image: url(@/assets/diy/title-step-3.svg);
            } 
        }
        .step-item:first-child::after,
        .step-item:nth-child(2)::after{
            background-color: #3067EF;
        }
        .step-item:nth-child(3){
            color: #333;
            .step-icon{
                background-image: url(@/assets/diy/title-step-2.svg);
            }
        }
    }
    .step-4{
        .step-item:first-child,
        .step-item:nth-child(2),
        .step-item:nth-child(3){
            color: #3067EF;
            .step-icon{
                background-image: url(@/assets/diy/title-step-3.svg);
            } 
        }
        .step-item:first-child::after,
        .step-item:nth-child(2)::after,
        .step-item:nth-child(3):after{
            background-color: #3067EF;
        }
    }
}
.diy-title-step::after{
    position: absolute;
    bottom: 0;
    left: 30px;
    content: '';
    height: 1px;
    width: 740px; 
    background-color: #EEEEEE;
}
</style>